/******************************************************************************
* SVN­Version­Information:
* ­­­­­­­­­­­­­­­­­­­­­­­­---------------------
* $LastChangedRevision: 6 $
* $LastChangedBy: c.a.duevel $
* $LastChangedDate: 2009-08-26 15:12:37 +0000 (Wed, 26 Aug 2009) $
* $HeadURL: http://robofight.googlecode.com/svn/trunk/ClientJavaFX/src/de/hft_stuttgart/robofight/client/javafx/util/Message.fx $
******************************************************************************/

package de.hft_stuttgart.robofight.client.javafx.util;

import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.Node;


import javafx.scene.control.Button;

import de.hft_stuttgart.robofight.client.javafx.Constants;

import javafx.scene.input.MouseEvent;

import javafx.scene.paint.Color;

import javafx.scene.text.Text;

import javafx.scene.Cursor;

/**
 * @author ralf.dauenhauer@gmx.de
 */

/**
 * Tooltip contains of a rectangle and a swinglabel
 */
public class Message extends CustomNode {


    public var msgBoxBackground : Node;
    public var msg : String;
    public var title : String = "Warning";

    var text = Text {
        font: Constants.FONT_TEXTFIELD
        fill: Color.WHITE
        layoutX: 30
        layoutY: 30
        content: msg
    }

    var button : Button = Button {
        text: "OK"
        layoutY : 90
        layoutX : 220
        action: function () {
            this.msgBox.visible = false;
            this.msgBox = null;
        }
        font: Constants.FONT_BUTTON
        cursor : Cursor.HAND
        width: 80
        height : 25
        skin : Constants.getButtonSkin();
    }

    var msgBox = Group {
        layoutY : 200
        layoutX : 150
          content: [
                msgBoxBackground,
                text,
                button
          ]
    }

    init {
        button.requestFocus();
    }

    override function create() : Node {
        return msgBox;
    }
}

